package com.spark.util.utils

import java.util.Properties
import com.spark.util.core.Logging

object PropertiesUtil extends Logging {

  private val properties = new Properties()

  def load(fileName:String):Unit = properties.load(this.getClass.getResourceAsStream("/"+fileName))

  def getString(key:String): String = properties.getProperty(key)

  def getInt(key:String):Int = properties.getProperty(key).toInt

  def main(args: Array[String]): Unit = {
    // "" 与 / 的区别
    println(this.getClass.getResource("").getPath)
    println(this.getClass.getResource("/").getPath)
  }
}
